/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.luxoft.corporate.blog.db.entities;

import java.util.Objects;

/**
 *
 * @author Egor
 */
public class User {

    private int userId;
    private String password;
    private String nick;
    private boolean isAuthor;
    public User() {
    }

    public User(int userId, String password, String nick, boolean isAuthor) {
        this.userId = userId;
        this.password = password;
        this.nick = nick;
        this.isAuthor = isAuthor;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    public boolean isIsAuthor() {
        return isAuthor;
    }

    public void setIsAuthor(boolean isAuthor) {
        this.isAuthor = isAuthor;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 67 * hash + this.userId;
        hash = 67 * hash + Objects.hashCode(this.password);
        hash = 67 * hash + Objects.hashCode(this.nick);
        hash = 67 * hash + (this.isAuthor ? 1 : 0);
        return hash;
    }


    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final User other = (User) obj;
        if (this.userId != other.userId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "User{" + "userId=" + userId + ", password=" + password + ", nick=" + nick + ", isAuthor=" + isAuthor + '}';
    }
    
    
    

}
